<template>
    <div class="app-container">
        <mt-header title="1809东铭组">
			<span slot="left" v-show="backflag" @click="backAction">
				<mt-button icon="back">返回</mt-button>
			</span>
		</mt-header>

		<transition name="transitionRouter" mode="out-in">
			<router-view></router-view>
		</transition>

        <nav class="mui-bar mui-bar-tab">
			
			<router-link class="mui-tab-item" to="/HomePage">
				<div @click="abb('/HomePage')">
					<span class="mui-icon mui-icon-home"></span>
					<span class="mui-tab-label">首页</span>
				</div>
			</router-link>
			<router-link class="mui-tab-item" to="/vip">
				<div @click="abb('/vip')">
					<span class="mui-icon mui-icon-contact"></span>
					<span class="mui-tab-label">个人</span>
				</div>
			</router-link>
			<router-link class="mui-tab-item" to="/shopping">
				<div @click="abb('/shopping')">
					<span id="end" class="mui-icon mui-icon-extra mui-icon-extra-cart"><span id="end" class="mui-badge" :class="isyou()?'show':'hidden'">{{this.$store.getters.getCount}}</span></span>
					<!-- <span ></span> -->
					<span class="mui-tab-label">购物车</span>
				</div>
			</router-link>
			<router-link class="mui-tab-item " to="/search">
				<div @click="abb('/search')">
					<span class="mui-icon mui-icon-search"></span>
					<span class="mui-tab-label">搜索</span>
				</div>
			</router-link>
		</nav>
    </div>
	
</template>  

<script>
export default {
	data(){
		return{

			backflag:false

		}
		
	},
	created(){
		
	},
	methods:{
		isyou(){
			
			if(this.$store.getters.getCount>0){
				return true;
			}else{
				return false;
			}
		},
		abb(a){
			this.$router.push({path:a})
		},
		backAction(){
			this.$router.back()
		}
	},

		watch:{
			"$route.path"(){
				if(this.$route.path !="/HomePage"){
					this.backflag=true
				}
				else{
					this.backflag=false
				}

			}
		}
	


}
</script>

<style >
.show{
	display: block;
}
.hidden{
	display: none;
}
* { touch-action: pan-y; }
    .app-container{
		padding: 40px 0 50px 0;
		overflow:scroll;
		height: 100%;
	}
	html{
		height:100%;
	}
	body{
		height:100%;
		overflow: hidden;
	}
	.transitionRouter-enter-active,
	.transitionRouter-leave-active {
    	transition: all 0.4s linear;
		transform: translate3d(0, 0, 0);
	} 
	.transitionRouter-enter,
	.transitionRouter-leave{
		opacity: 0;
		transform: translate3d(100%, 0, 0);
	}
	.mint-header{
		position: absolute;
		top: 0;
		width: 100%;
		z-index: 3;
	}
</style>

